Card Dealing Math
Once I wrote a blog essay titled Seven, Ace, Queen, Two, Eight, Three, Jack, Four, Nine, Five, King, Six, Ten. It was about a “magic” card trick. Magic trick. Take a deck of cards face down. Move the top card to the bottom, then deal the new top card face-up on the table. Repeat this process until all the cards are dealt. And — abracadabra — the cards come out in perfect order!
If you want to perform this trick with one suit, the title of that earlier post tells you exactly how to stack your deck.
In the fall of 2023, I gave this trick as a homework problem to my STEP students. The result? We ended up writing a 40-page paper, Card Dealing Math, now available on the arXiv. At one point, we seriously considered calling it The Art of the Deal, but decided against it.
In the homework version, the deck consisted of cards from a single suit, but we generalized it to a deck of N cards labeled 1 through N. The dealing process we studied is called under–down dealing: you alternate between placing one card under the deck and then dealing the next one face-up. It’s very similar to down–under dealing, where you start by dealing the first card instead. These two patterns are often, unsurprisingly, called the Australian dealings.
The under-down dealing turns out to be mathematically equivalent to the Josephus problem. In that famous ancient problem, people are arranged in a circle, and you repeatedly skip one person and execute the next (much grimmer than playing with cards). The classic question asks: given N people, who survives? In our card context, this corresponds to asking where the card labeled N ends up in the prepared deck.
More generally, the Josephus problem can ask the following question. If we number the people in a circle 1 through N, in what order are they eliminated? In our research, we flipped the question around: how should we number the people in the circle so that they’re eliminated in increasing order?
Naturally, we couldn’t stop there. We explored several other dealing patterns, discovered delightful mathematical properties, and along the way added 44 new sequences to the OEIS. The funnest part? We also invented a few brand-new card tricks.
Share:
Leave a comment